package com.wlyuan.open.scanner.domain.quotation;

import com.wlyuan.open.scanner.dao.entity.QuotationRelationDO;
import com.wlyuan.open.scanner.utils.mappings.MappingInvalid;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author lijing
 * @description
 */
public class QuotationRelationConvert {

    private static final Convert CONVERT = Mappers.getMapper(Convert.class);

    @Mapper(uses = {MappingInvalid.class})
    public interface Convert {

        /**
         * 转换
         *
         * @param source
         * @return
         */
        QuotationRelation convert(QuotationRelationDO source);

        /**
         * 转换
         *
         * @param source
         * @return
         */
        List<QuotationRelation> convert(List<QuotationRelationDO> source);

    }

    public static List<QuotationRelation> convert(List<QuotationRelationDO> creation) {
        return CONVERT.convert(creation);
    }

    public static QuotationRelation convert(QuotationRelationDO source) {
        return CONVERT.convert(source);
    }

}
